package org.garunicode.connect

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.webkit.WebView
import android.webkit.WebViewClient

class MainActivity : AppCompatActivity() {
    @SuppressLint("SetJavaScriptEnabled")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val webView: WebView = findViewById(R.id.webView)
        webView.settings.javaScriptEnabled = true
        webView.getSettings().javaScriptEnabled = true
        webView.getSettings().domStorageEnabled = true
        webView.getSettings().allowFileAccess = true
        webView.getSettings().allowContentAccess = true
        webView.webViewClient = WebViewClient()

        // 加载本地HTML文件
        webView.loadUrl("file:///android_asset/index.html")
    }
}